<%--
The Community Project
Copyright Team1 Productions

Joshua Amick
Stephen Cunningham
Thema Davis
Tomika Dawson
Lucie DeCristifaro

This JSP is an implementation of the user interface for the Community Project.  Several
tag libraries and custom libraries are used.

All Rights reserved.
--%>

<%@ page %>
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>

<%-- jstl taglibs --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%-- struts taglibs --%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%-- custom taglib by Josh --%>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags/custom" %>

<c:set var="basePath">
	${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}
</c:set>
<c:set var="servletPath">
	${pageContext.request.servletPath}
</c:set>

<base href="${basePath}/" />

<custom:frame>
	<div id="styleTitle">	
		Search Profiles
	</div>
	</br>
	
	<html:form action="/SearchProfile" method="post" enctype="multipart/form-data">
		Username&nbsp;<html:text property="username"/><br/>
		First Name&nbsp;<html:text property="firstName"/><br/>
		Last Name&nbsp;<html:text property="lastName"/><br/>
	    Major&nbsp;<html:select property="major" value="Major">
	        <html:option value="Major"/>
	        <html:option value="Computer Science"/>
	        <html:option value="Computer Engineering"/>
	        <html:option value="Computer Information Systems"/>
	        <html:option value="Other"/>
	    </html:select><br/>
	    <html:submit value="&nbsp;Submit&nbsp;"/>
    </html:form>
    <c:choose>
		<c:when test="${not empty SEARCH_RESULTS}">
			<display:table name="SEARCH_RESULTS">
			  <display:column property="username" title="Username" />
			  <display:column property="profile.firstName" title="First Name" />
			  <display:column property="profile.lastName" title="Last Name" />
			  <display:column property="profile.major" title="Major" />
			  <display:column title="View" property="keyId" href="${basePath}/Forward.do?loc=viewProfile" paramId="objKeyId" paramProperty="keyId"/>
			</display:table>
		</c:when>
		<c:otherwise>
			<p>There are no results to display at this time.</p>
		</c:otherwise>
	</c:choose>
</custom:frame>


